package com.ibuonline.b2b.member.dao;

import java.util.ArrayList;
import java.util.List;

import com.dimeng.common.base.SuperDAO;
import com.ibuonline.b2b.entity.CompanyDetail;

public class CompanyDetailDAO extends SuperDAO<CompanyDetail> {

	public int updateCompanyAfterDelImage(String path,String type,Integer companyId){
		String sql = "";
		List<Object> params = new ArrayList<Object>();
		if(type.equals("logo")){
			sql = "update company set logo = null where company_id= ? and logo = ?";
			params.add(companyId);
			params.add(path);
		}else if(type.equals("pic")){
			sql = "update company set company_pic = null where company_id = ? and company_pic = ?";
			params.add(companyId);
			params.add(path);
		}
		return jdbcTemplate.update(sql,params.toArray());
	}
}
